
package com.jf.cloud.api.multishop.feign;

import com.jf.cloud.common.feign.FeignInsideAuthConfig;
import com.jf.cloud.common.response.ServerResponseEntity;
import com.jf.cloud.common.vo.ShopSubstituteSalesVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author zz
 * @date 2022/6/24 15:36
 */
@FeignClient(value = "jfcloud-multishop",contextId = "ShopSubstituteSales")
public interface ShopSubstituteSalesFeignClient {

    /**
     * 根据店铺id获取代销设置类型
     *
     * @param shopId 店铺设置表id
     * @return 代销设置表
     */
    @GetMapping(value = FeignInsideAuthConfig.FEIGN_URL_PREFIX + "/insider/ShopSubstituteSales/getByShopSubstituteSalesId")
    ServerResponseEntity<ShopSubstituteSalesVO> getByShopSubstituteSalesId(@RequestParam("shopId") Long shopId);


    /**
     * 根据店铺id列表获取代销设置类型
     *
     * @param shopIdList 店铺设置表id
     * @return 代销设置表
     */
    @GetMapping(value = FeignInsideAuthConfig.FEIGN_URL_PREFIX + "/insider/ShopSubstituteSales/shopSubstituteSalesList")
    ServerResponseEntity<List<ShopSubstituteSalesVO>> shopSubstituteSalesList(@RequestParam("shopId") List<Long> shopIdList);

    /**
     * 保存店铺默认代销设置
     * @param shopId
     * @return
     */
    @GetMapping(value = FeignInsideAuthConfig.FEIGN_URL_PREFIX + "/insider/ShopSubstituteSales/savaDefault")
    ServerResponseEntity<Void> saveDefault(@RequestParam("shopId") Long shopId);
}
